import hashlib

# md5加密


def hash_md5(arg):
    arg_hash = hashlib.md5(arg.encode('UTF-8'))
    result = arg_hash.hexdigest()
    return result

# 邮箱加密（保留前后两位与最后的@）


def encrypt_email(arg):
    middle_email = arg[2:-4]
    middle_content = ''
    
    for i in middle_email:
        if i != '@':
            middle_content += '*'
        else:
            middle_content += i
    
    
    result = arg[0:2] + middle_content + arg[-4:]

    return result